Universal Serial Bus (USB) was developed to offer PC users a standardized interface for connecting many different types of peripheral devices to their computers. The development of USB was initially driven by the constraints of laptop computers, which provided limited space for peripheral connection ports, but were expected to interface with a an evolving set of personal electronic devices. Providing specialized ports for a broad range of peripheral devices is infeasible for desktop PCs and practically impossible for laptop PCs. Consequently, laptops benefited greatly from a standardized, small-profile peripheral connection port that could be used for coupling many different types of peripherals. USB eliminates the need for a PC to provide different ports for various printers, keyboards, mice, and other peripherals. The common and straightforward interface provided by USB has become increasingly important with the proliferation of personal mobile devices.
In providing connectivity for a variety of peripheral devices, USB supports the transfer of a variety of data types, from relatively slow mouse inputs to digitized streaming audio and video. The capabilities of the USB interface are defined by a widely-adopted specification developed jointly by PC, peripheral and software manufacturers. USB has become the hardware interface of choice for PC peripherals because it offers users standardized and straightforward connectivity and it supports connectivity for a variety of peripheral devices. Consequently, USB has proliferated beyond being a hardware interface for PC peripherals and is now a common interface for a wide variety of personal electronic devices ranging from cell phones to car stereos to alarm clocks.
Until relatively recently, the roles of USB participants were strictly defined as either USB hosts or USB devices, with USB devices being either peripheral devices or hubs. A USB host was restricted to that role, which requires the host to support several functions, including detecting the connection status of USB devices, managing error-free data flow with connected USB devices, and providing power to connected USB devices. Conversely, a USB device was limited to responding to request from a USB host. Importantly, two USB devices could not communicate with each other directly. USB devices were limited to communicating with a USB host.
More recently, greater interoperability between USB-enabled devices is supported by the On-the-Go (OTG) addition to the USB specification. OTG expands the USB specification to allow traditional USB devices to be configured to serve as limited-purpose USB host. Thus, a USB-enabled device can serve as either a USB host or a USB device, but cannot serve both roles at the same time. For example, the conventional USB specification allows a PC laptop to serve as a USB host when connected to a USB peripheral device, such as mobile phone. Per conventional USB, the mobile phone could serve only as a peripheral USB device and could not also serve as a USB host to other USB devices. The OTG addition to USB specification allows a peripheral USB device to also serve as a USB host to other peripheral USB devices. For example, the mobile phone would be peripheral USB device with respect to the laptop but could be disconnected from the laptop USB host and the mobile phone could instead be configured to serve as a USB host to a digital camera USB peripheral device. With the traditional roles of USB host and peripheral device less rigidly defined per the OTG addition to the USB specification, a wider variety of USB couplings has resulted. Modern USB devices are designed for interoperability with an increasingly large set of other USB devices as users become accustomed to an increasingly diverse set of USB devices being able to communicate with each other via USB.
Two types of devices that commonly utilize OTG are digital audio players and mobile telephones equipped with USB couplings, robust audio storage and streaming playback capabilities. Users can stream audio data from a mobile phone device for playback by a digital audio player via a USB coupling between the two devices. In order to provide these audio capabilities, such devices include one or more audio codecs.
In order to transmit and play audio data, devices must convert between analog and digital versions of the audio signal. Conversion of an analog source signal to digital representation of the signal involves sampling the analog source signal. Codecs are the hardware and/or software components of an electronic device that convert audio signal between analog and digital formats. Codecs are typically two-way components that include both analog-to-digital and digital-to-analog conversion capabilities. When converting an analog source signal to a digital signal, a codec samples the analog signal on a periodic basis and encodes each sample into a discrete set of digital information. The frequency at which the codec samples the analog source signal is referred to as the sampling rate. With a higher sample rate, more frequent digital encoding of the analog signal occurs and more digital information is generated per unit of time.
A codec typically supports multiple sampling rates. The selection of a sampling rate to be used by a codec in converting analog to digital audio data commonly seeks to balance the desire for high-fidelity audio and the need to generate manageable amounts for digital information. High-fidelity audio is usually preferred over lower-fidelity audio since it preserves more of the audio information present in the original analog source signal. However, higher-fidelity audio requires sampling at higher frequencies and thus generates more digital data than a lower-fidelity sample. Since the digital audio data needs to be stored and transmitted, the amount of the available capacity for storing the digital signal and the bandwidth available for transmitting the digital signal are factors that impact the selection of a sample rate.
A common use of USB-enabled devices is to stream audio data between the devices. When used in the fashion, the device on which the audio data is stored is a USB host. The host device retrieves stored audio data and streams it to the recipient USB device via the USB coupling. Since the audio data is stored on the USB host, it is preserved at a sample rate that is compatible with the audio codecs of the host and which meets the fidelity and storage space requirements of the host user. The sample rate of audio data stored on the USB host is also dictated at least in part by the use of the audio data. For example, CD audio data is sampled at 44.1 kHz, most professional audio and video equipment samples at 48 kHz and DVD and Blu-ray are both sampled at 96 kHz.
In light of the fact that USB-capable devices are highly diverse in terms of storage capacity and data transmission capabilities and constraints, USB devices utilize a variety of sample rates for converting analog audio source signals to digital data. With the proliferation of USB-enabled devices that support OTG, users are increasingly afforded the opportunity to couple a wider variety of USB devices together. Coupled USB devices are commonly used to stream audio data between the devices via the USB coupling. When coupled USB devices interoperate in this fashion, a problem arises when the digital audio signal being streamed from the USB source device is sampled a different rate than what is required for playback by the USB receiving device.
Thus arises the need to convert the sampling rate of the digital signal according to the requirements of the receiving device. Sample rate conversion is the process of converting a digital audio signal from one sample rate to another, while altering the signal as little as possible.
In order to implement a sample rate converter, a clock signal is needed that can operate at the frequency (i.e., sample rate) desired for the converted digital audio signal. It is also desirable to oversample the converted digital audio signal because oversampling facilitates easier conversion of the digital signal back to an analog signal. Occasionally, the need to down sample the source signal (i.e., generate an output with a lower sample frequency than the source signal) is also present. Consequently, a sample rate converter requires a clock signal that operates at a configurable frequency according to the needs of individual conversions.
In order to generate the clock signal for a sample rate converter, prior art systems are known to utilize conversion circuitry present externally from the microcontroller of the audio codec. In such systems, the sample rate converter operates according to a clock signal available outside the microcontroller. Such systems that utilize external sample rate converters are disfavored because of the increased manufacturing costs and complexity when compared to a sample rate converter present within the audio codec microcontroller circuitry. At minimum, an external sample rate converter must be able to communicate data with the audio codec microcontroller. Most commonly, this requires a dedicated, hardwired connection between the two components, which increasing manufacturing costs and complexity.
Prior art audio codecs are also known to implement source code converters using a clock signal provided by a dedicated crystal oscillator. A dedicated crystal oscillator provides the source code converter with a great degree of configurability and accuracy. However, the addition of a crystal oscillator dedicated for use by the sample rate converter again adds significant manufacturing cost and complexity and also increases the power consumption of the device.
Prior art audio codecs are also known to utilize sample rate converters implemented using a dedicated phase-locked loop (PLL) circuit to recover a clock signal from an existing signal. A dedicated PLL circuit for use by a sample rate converter again adds significant manufacturing cost and complexity and also increases the power consumption of the device.
Accordingly, a sample rate converter is desired that can accommodate a range of sampling rates that utilizes existing clock signals instead of dedicated clock recovery or clock generation components.